/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package session;

import entities.BookRooms;
import entities.OrderFoodDetails;
import java.util.ArrayList;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

/**
 *
 * @author TANGQUOCTUAN
 */
@Stateless
public class OrderFoodDetailsFacade extends AbstractFacade<OrderFoodDetails> implements OrderFoodDetailsFacadeLocal {

    @PersistenceContext(unitName = "eProject_Tunga_Restaurant-ejbPU")
    private EntityManager em;

    protected EntityManager getEntityManager() {
        return em;
    }

    public OrderFoodDetailsFacade() {
        super(OrderFoodDetails.class);
    }

    public List<OrderFoodDetails> showallbyID(int id) {
        List<OrderFoodDetails> list = new ArrayList<OrderFoodDetails>();
        Query r = em.createNamedQuery("OrderFoodDetails.findAllByID");
        r.setParameter("oderFoodID", id);
        return list = r.getResultList();
    }
}
